package com.zzzzzz.test;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
@ImportResource("classpath:security.xml")
public class SecurityConfig {
	
//	@Bean
//	public Realm configureRealm(){
//		return new ShiroDbRealm();
//	}
//	
//	@Bean(name = "securityManager")
//	public DefaultWebSecurityManager configureSecurityManager(){
//		DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
//		securityManager.setRealm(configureRealm());
//		return securityManager;
//	}
//	
//	@Bean(name = "lifecycleBeanPostProcessor")
//	public LifecycleBeanPostProcessor configureLifecycleBeanPostProcessor(){
//		LifecycleBeanPostProcessor lifecycleBeanPostProcessor = new LifecycleBeanPostProcessor();
//		return lifecycleBeanPostProcessor;
//	}
//	
//	@Bean(name = "shiroFilter")
//	public ShiroFilterFactoryBean configureShiroFilterFactoryBean(){
//		ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
//		shiroFilterFactoryBean.setSecurityManager(configureSecurityManager());
//		shiroFilterFactoryBean.setLoginUrl("/login");
//		shiroFilterFactoryBean.setUnauthorizedUrl("/unauthorized");
//		Map<String, javax.servlet.Filter> filters = new HashMap<String, javax.servlet.Filter>();
//		filters.put("authc", new PassThruAuthenticationFilter());
//		shiroFilterFactoryBean.setFilters(filters);
//		shiroFilterFactoryBean.setFilterChainDefinitions("/control_panel/** = roles[administrator]");
//		return shiroFilterFactoryBean;
//	}
}
